package com.yuanfeng.base.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanfeng.base.dto.WebSystemConfigQueryDTO;
import com.yuanfeng.base.entity.BaseSysConfigsEntity;
import com.yuanfeng.base.vo.SystemConfigHallSlideVO;
import com.yuanfeng.base.vo.index.WabSystemConfigHallVO;
import com.yuanfeng.base.vo.index.WebSystemConfigQueryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
* @Entity com.yuanfeng.base.entity.MerchantSysConfigs
*/
@Mapper
public interface BaseSysConfigsMapper extends BaseMapper<BaseSysConfigsEntity> {

    /**
     * 根据configKey 查询
     * @param configKey
     * @return
     */
    String selectConfigValue(@Param("configKey") String configKey);

    /**
     * 查询轮播配置
     * @param param
     * @return
     */
    List<WebSystemConfigQueryVO> selectByParam(@Param("param")WebSystemConfigQueryDTO param);

    /**
     * 热搜词
     * @param search
     * @return
     */
    List<WabSystemConfigHallVO> selectByConfigType(@Param("configType")String search);

    List<WabSystemConfigHallVO> selectByConfigTypesearch(@Param("configType")String search);

    /**
     * 获取上传图片配置地址
     * @param configKey
     * @return
     */
    String getImageConfigUrl(@Param("configKey")String configKey);

    /**
     * 根据config_type 查询
     * @param integral_image
     * @return
     */
    List<BaseSysConfigsEntity> queryIntegralIndex(String integral_image);

    /**
     * 查询商城客服及邮箱
     *
     * @return
     */
    List<SystemConfigHallSlideVO> selectPhoneAndMail();

    String selectCommonNameByGoodId(Integer goodsId);

    String selectCommonName(Integer commonId);

    String selectByShopName(Integer shopId);

    String selectByCatNameString(Integer catId);


    /**
     * 修改设置
     *
     * @param systemConfigAddParam
     */
    void updateSetting(@Param("param") List<BaseSysConfigsEntity> systemConfigAddParam);

    /**
     * 查询配置
     * @param param
     * @return
     */
    String selectBaseWebConfig(@Param("param") String param);
}
